<!DOCTYPE html>
<html class="x-admin-sm">
    {include file='public/header'}
    <script src="/admin/xadmin/lib/layui/upload.js" charset="utf-8"></script>
    <style>
        .layui-form-label {
            width: 110px;
        }
        .layui-input-block {
            margin-left: 140px;
        }
    </style>
    <body>
        <div class="x-body">
            <form class="layui-form" lay-filter="formAjax">
                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <span class="x-red">*</span>短剧名称
                    </label>
                    <div class="layui-input-block">
                        <input type="text" disabled  id="name" placeholder="短剧名称" required="required" lay-verify="required" autocomplete="off" class="layui-input" value=""/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <span class="x-red">*</span>充值模版
                    </label>
                    <div id="pMenu1" style="width:100%;flex:1"></div>
                </div>

              

                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <span class="x-red">*</span>平台类型
                    </label>
                    <div class="layui-input-block">
                        <select class="project-select" style="width: 150px;" id="selectOne" name="platform" lay-filter="selectOne">
                            <option value="">请选择平台类型</option>
                            <option value="1">抖小-比翼鸟短剧</option>
                            <option value="2">快小-比翼鸟短剧</option>
                        </select>
                    </div>
                </div>
                <!-- <div class="layui-form-item">
                    <label class="layui-form-label">
                        <span class="x-red">*</span>开始收费集数
                    </label>
                    <div class="layui-input-block">

                        <input type="text" name="sort" id="sort"  type="number" placeholder="收费集数" required="required" lay-verify="required" autocomplete="off" onchange="if(/\D/.test(this.value)){alert('只能输入数字');this.value='';}" class="layui-input" value=""/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <span class="x-red">*</span>每集收费K币
                    </label>
                    <div class="layui-input-block">
                        <input type="text" name="pay_amount" id="pay_amount" placeholder="每集收费K币" required="pay_amount" type="number" lay-verify="required" autocomplete="off" class="layui-input" onchange="if(/\D/.test(parseInt(this.value ) )){alert('只能输入数字');this.value='';}" value=""/>
                    </div>
                </div> -->


                <input type="hidden" name="video_id" id="video_id" value=""/>
                <input type="hidden" name="id" id="id" value=""/>
                <button id="submitData" class="layui-btn" lay-submit lay-filter="submitData" style="display: none;"/>

            </form>
        </div>
        <script>
            let video_name = GetQueryString('video_name')
            let video_id = GetQueryString('video_id')
            $('#name').val(decodeURI( GetQueryString('video_name')))
            $('#video_id').val(video_id)

            let params = {
                addUrl: '/admin/videoDetail/rechargeConfig',
                editUrl: '/admin/videoDetail/editRechargeConfig',
                detailUrl: '/admin/videoDetail/rechargeConfigDetail'
            }
            form_ajax(params)

            let selectParams1 = {
                url: '/admin/money/rechargeTemplateSelect?video_id='+video_id,
                selected: [],
                tips: '选择充值模版',
                name: 'recharge_template_id',
                field_id: 'id',
                field_Name: 'name',
                elem: '#pMenu1'
            }
            let id = GetQueryString('id')
            if (id) {
                $('#selectOne').attr('disabled',true)
                Ajax(params.detailUrl, {id}).then(result => { // selectParams.selected = [result.data.company_id]
                    selectParams1.selected = [result.data.recharge_template_id]
                    selectN(selectParams1)

                });
            } else {
                selectN(selectParams1)
            }
        </script>
    </body>

</html>
